﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DataStructures
{
	public class TreeEnumerable<Element, Tree, TreeList> : BaseEnumerable<Element, Tree, TreeList, Tree>
		where Tree : IBaseTree<Element, Tree, TreeList>
		where TreeList : IBaseTreeList<Element, Tree, TreeList>
	{
		#region ctors
		public TreeEnumerable(Tree parent) : base(parent) { }
		#endregion ctors

		#region methods
		public override Tree[] ToArray(TraversalType type)
		{
			List<Tree> list = new List<Tree>();
			ITreeVisitor<Tree> visitor = new BuildTreeListVisitor<Tree>(list);
			Traverse(visitor);
			return list.ToArray();
		}
		#endregion methods

		#region fields
		#endregion fields
	}
}
